package com.job.GaoYuXuan.Homework0702;

/**
 * @author 盖
 * @version 1.0
 * @since 2022-07-02 16:52:42
 */
public class Job0702MyTool {
    public static int[] Bubblesort(int[] number){
        for (int i = 0; i <number.length - 1; i++){
            for (int j = 0; j < number.length - 1 - i; j++){
                if (number[j] < number[j + 1]){
                    int temp = number[j];
                    number[j] = number[j + 1];
                    number[j + 1] = temp;
                }
            }
        }
        return number;
    }
    public static int[] Selectsort(int[] number){
        for (int i = 0; i < number.length - 1; i++){
            for (int j = i; j < number.length; j++){
                if (number[i] < number[j]){
                    int temp = number[i];
                    number[i] = number[j];
                    number[j] = temp;
                }
            }
        }
        return number;
    }
}